-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "karmor profile --save" command #472
base: main
Are you sure you want to change the base?
Conversation
Sir, can you please review this. Let me know if this require any changes, I would love to learn about the best practices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works, tested locally. @Affan-7 kindly fix the ci-gosec failures
@Aryan-sharma11 fixed the gosec failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reuse and refactor functions from recommend directory into utils to avoid complications and duplicate code
kubearmor-client/recommend/recommend.go
Line 81 in 9ad1b99
func createOutDir(dir string) error { |
profile/Client/profileClient.go
Outdated
err := os.MkdirAll(filepath, 0600) | ||
err = os.WriteFile(filepath+Operation+".json", []byte(jsonArray[0]), 0600) | ||
directory := "Profile_Summary/" | ||
err := os.MkdirAll(directory, 0700) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err := os.MkdirAll(directory, 0700) | |
err := os.MkdirAll(directory, 0600) |
Why do we need exec permission?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Mohammed Affan <[email protected]>
Fixes #381